/**
 * Created by Administrator on 2017/3/23.
 */
$(document).ready(function(){
    $("#name").blur(function () {
        var name = $("#name").val();
        if(name == ""){
            $(".name-tip").text("收货人姓名不能为空！请输入");
            $(".name-tip").css("color","#FF3030");
        }else {
            $(".name-tip").text("收货人");
            $(".name-tip").css("color","#696969");
        }
    });
    $("#phone").blur(function () {
        var phone = $("#phone").val();
        if(phone == ""){
            $(".phone-tip").text("联系电话不能为空！请输入");
            $(".phone-tip").css("color","#FF3030");
        }else {
            $(".phone-tip").text("联系电话");
            $(".phone-tip").css("color","#696969");
        }
    });
    $("#address").blur(function () {
        var address = $("#address").val();
        if(address == ""){
            $(".address-tip").text("收货地址不能为空！请输入");
            $(".address-tip").css("color","#FF3030");
        }else {
            $(".address-tip").text("收货地址");
            $(".address-tip").css("color","#696969");
        }
    });
    $("#code").blur(function () {
        var code = $("#code").val();
        if(code == ""){
            $(".code-tip").text("邮政编码不能为空！请输入");
            $(".code-tip").css("color","#FF3030");
        }else {
            $(".code-tip").text("邮政编码");
            $(".code-tip").css("color","#696969");
        }
    });

    $("#add_address").on("click",function () {
        $(".add-address").show();
    });

    $("#cancel").on("click",function () {
        $(".add-address").hide();
    });

});

